<template>
  <view class="comm-box">
    <view class="comm-tabs">
      <uv-tabs
        :list="list"
        @click="click"
        activeStyle="color: #008c8c"
        lineColor="#008c8c"
        :scrollable="false"
      ></uv-tabs>
    </view>
    <!-- 默认 -->
    <view class="comm-top" v-if="cure == 0">
      <view class="com-top" v-for="item in 2">
        <view class="comm-list">
          <view class="co-item">
            <view class="co-img">
              <uv-avatar
                src="/static/image/tx.png"
                shape="circle"
                size="55"
              ></uv-avatar>
            </view>
            <view class="co-name">
              <view class="co-nametext">陈喜喜</view>
              <view class="co-time">2023-06-08 上午10:30</view>
            </view>
          </view>
          <view class="co-itemm">
            熟悉的习惯，熟悉的路线，熟悉的日子里，永远不会有奇迹发生。改变思路，改变习惯，改变一种活的方式，往往会创造无限，风景无限!
          </view>
        </view>
        <view class="comm-img" @click="godtxq">
          <view class="co-imgs">
            <image
              src="https://picsum.photos/200/100?1"
              mode="scaleToFill"
            />
          </view>
          <view class="co-s">
            <uv-icon name="heart" label="56" size="30"></uv-icon>
            <uv-icon name="chat" label="265" size="30"></uv-icon>
            <uv-icon name="share" label="分享" size="30"></uv-icon>
          </view>
        </view>
      </view>
    </view>
    <!-- 点赞 -->
    <view class="com-d" v-if="cure == 1">
      <view class="com-top" v-for="item in 2">
        <view class="comm-list">
          <view class="co-item">
            <view class="co-img">
              <uv-avatar
                src="/static/image/tx.png"
                shape="circle"
                size="55"
              ></uv-avatar>
            </view>
            <view class="co-name">
              <view class="co-nametext">陈喜喜</view>
              <view class="co-time">2023-06-08 上午10:30</view>
            </view>
          </view>
          <view class="co-itemm">
            熟悉的习惯，熟悉的路线，熟悉的日子里，永远不会有奇迹发生。改变思路，改变习惯，改变一种活的方式，往往会创造无限，风景无限!
          </view>
        </view>
        <view class="comm-img">
          <view class="co-imgs">
            <image
              src="https://picsum.photos/id/237/200/100"
              mode="scaleToFill"
            />
          </view>
          <view class="co-s">
            <uv-icon name="heart" label="56" size="30"></uv-icon>
            <uv-icon name="chat" label="265" size="30"></uv-icon>
            <uv-icon name="share" label="分享" size="30"></uv-icon>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref } from "vue";
const cure = ref(0);
const list = ref([{ name: "默认" }, { name: "点赞" }]);
const click = (item) => {
  console.log("item", item);
  cure.value = item.index;
};
const godtxq=()=>{
  uni.navigateTo({
    url: '/pages/dynamicdetails/dynamicdetails'
  })
}
</script>

<style lang="scss" scoped>
@import url(./community.css);
</style>
